﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace houseAgency.Models
{
    public class MenuNode : ObservableObject
    {
		public MenuNode()
		{
			ChildMenuList = new ObservableCollection<MenuNode>();
		}
		public int ID { get; set; }
		public string? Node { get; set; }
        public string? Url { get; set; }

        private ObservableCollection<MenuNode>? childMenuList;

		public ObservableCollection<MenuNode>? ChildMenuList
		{
			get { return childMenuList; }
			set
			{
				childMenuList = value;
				OnPropertyChanged();
			}
		}
        public ICommand MenuCommand
        {
            get
            {
                return new RelayCommand<MenuNode>(o =>
                {
                    MessageBox.Show("目前还没有实现！请点击左侧菜单栏");
                    //if (o.ChildMenuList.Count == 0)
                    //{
                    //    MessageBox.Show(o.Node);
                    //}
                });
            }
        }

    }
}
